package com.zzh.study.config;

import org.springframework.context.annotation.Bean;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.*;

/**
 * @PackageName:com.zzh.study.config
 * @ClassName:WebflxuRouting
 * @Description:
 * @author:zhangzhanheng
 * @date: 2020/12/18 15:35
 */
@Component
public class WebflxuRouting {

    @Bean
    public RouterFunction<ServerResponse> rote(WebfluxHandler webfluxHandler){
        return RouterFunctions.route(RequestPredicates.GET("/hello")
                .and(RequestPredicates.accept(MediaType.TEXT_PLAIN)),webfluxHandler::hello);

    }
}
